﻿using System.Text.Json.Serialization;

namespace TowerCraneMonitorClient.NetClient
{
    public abstract class Entity
    {
        /// <summary>
        /// 主键
        /// </summary>
        [JsonIgnore]
        public long Id { get; private set; }

        /// <summary>
        /// 基于该对象生成 Request 报文
        /// </summary>
        /// <param name="errorMessage">失败时返回错误信息，成功时返回 null</param>
        /// <returns>成功时返回 Request 对象，失败时返回 null</returns>
        public virtual Request ToReq() => new Request();
    }
}
